package com.up.management.domain.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.up.common.annotation.Excel;

import java.util.Date;

/**
 * 评论管理视图对象 VO
 * 用于前端展示与导出
 */
public class EventCommentVO {

    @Excel(name = "评论ID")
    private Long commentId;

    @Excel(name = "所属活动ID")
    private Long eventId;

    @Excel(name = "评论用户ID")
    private Long userId;

    @Excel(name = "父评论ID")
    private Long parentId;

    @Excel(name = "顶级评论ID")
    private Long topId;

    @Excel(name = "评论内容")
    private String content;

    @Excel(name = "评论状态")
    private Long status;

    @Excel(name = "创建人")
    private String createBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @Excel(name = "更新人")
    private String updateBy;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @Excel(name = "备注")
    private String remark;

    @Excel(name = "父评论")
    private String parentContent;

    @Excel(name = "顶级评论")
    private String topContent;

    @Excel(name = "活动名称")
    private String eventName;

    @Excel(name = "用户名")
    private String username;

    public Long getCommentId() { return commentId; }
    public void setCommentId(Long commentId) { this.commentId = commentId; }

    public Long getEventId() { return eventId; }
    public void setEventId(Long eventId) { this.eventId = eventId; }

    public Long getUserId() { return userId; }
    public void setUserId(Long userId) { this.userId = userId; }

    public Long getParentId() { return parentId; }
    public void setParentId(Long parentId) { this.parentId = parentId; }

    public Long getTopId() { return topId; }
    public void setTopId(Long topId) { this.topId = topId; }

    public String getContent() { return content; }
    public void setContent(String content) { this.content = content; }

    public Long getStatus() { return status; }
    public void setStatus(Long status) { this.status = status; }

    public String getCreateBy() { return createBy; }
    public void setCreateBy(String createBy) { this.createBy = createBy; }

    public Date getCreateTime() { return createTime; }
    public void setCreateTime(Date createTime) { this.createTime = createTime; }

    public String getUpdateBy() { return updateBy; }
    public void setUpdateBy(String updateBy) { this.updateBy = updateBy; }

    public Date getUpdateTime() { return updateTime; }
    public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; }

    public String getRemark() { return remark; }
    public void setRemark(String remark) { this.remark = remark; }

    public String getParentContent() { return parentContent; }
    public void setParentContent(String parentContent) { this.parentContent = parentContent; }

    public String getTopContent() { return topContent; }
    public void setTopContent(String topContent) { this.topContent = topContent; }

    public String getEventName() { return eventName; }
    public void setEventName(String eventName) { this.eventName = eventName; }

    public String getUsername() { return username; }
    public void setUsername(String username) { this.username = username; }

    // 从实体转换为VO
    public static EventCommentVO fromEntity(com.up.management.domain.entity.EventComment e) {
        if (e == null) return null;
        EventCommentVO vo = new EventCommentVO();
        vo.setCommentId(e.getCommentId());
        vo.setEventId(e.getEventId());
        vo.setUserId(e.getUserId());
        vo.setParentId(e.getParentId());
        vo.setTopId(e.getTopId());
        vo.setContent(e.getContent());
        vo.setStatus(e.getStatus());
        vo.setCreateBy(e.getCreateBy());
        vo.setCreateTime(e.getCreateTime());
        vo.setUpdateBy(e.getUpdateBy());
        vo.setUpdateTime(e.getUpdateTime());
        vo.setRemark(e.getRemark());
        vo.setParentContent(e.getParentContent());
        return vo;
    }
}